package xuanke;

public class Course {
    private String id;          // 课程编号
    private String courseName;  // 课程名称
    private String location;    // 上课地点
    private String time;        // 上课时间
    private Teacher teacher;    // 授课教师
    
    // 构造方法
    public Course(String id, String courseName, String location, String time) {
        this.id = id;
        this.courseName = courseName;
        this.location = location;
        this.time = time;
    }
    
    // getter和setter方法
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    
    public String getCourseName() { return courseName; }
    public void setCourseName(String courseName) { this.courseName = courseName; }
    
    public String getLocation() { return location; }
    public void setLocation(String location) { this.location = location; }
    
    public String getTime() { return time; }
    public void setTime(String time) { this.time = time; }
    
    public Teacher getTeacher() { return teacher; }
    public void setTeacher(Teacher teacher) { this.teacher = teacher; }
    
    // 课程信息展示
    public void displayInfo() {
        System.out.println("课程编号：" + id);
        System.out.println("课程名称：" + courseName);
        System.out.println("上课地点：" + location);
        System.out.println("上课时间：" + time);
        System.out.println("授课教师：" + teacher.getName());
    }
}
